-- Prefan Access Controller
-- Admin Protector

if not SERVER then return end

function PAC.MonitorDamage( ent, inflictor, attacker, ammount, dmginfo )

	if ent:IsPlayer() and attacker:IsPlayer() then
	
		if PAC.IsAllowed( ent, PAC.MonitorDamage ) then
			
			attacker:SetHealth( attacker:Health() - dmginfo:GetDamage() )
			
			if attacker:Health() <= 0 then attacker:Kill() end
			
		end
		
	end
	
end
PAC.AddHook( "EntityTakeDamage", "PAC_MonitorDamage", PAC.MonitorDamage )

PAC.AddPlugin( "Admin Damage Monitor", "Protects Admins from damage!", "Prefanatic" )
